home *** CD-ROM | disk | FTP | other *** search
- Path: news.kreonet.re.kr!usenet
- From: jwhahn@cair.kaist.ac.kr (Jung Hahn)
- Newsgroups: comp.lang.c++
- Subject: You want Recursion .... come and get it ... right here
- Date: Wed, 07 Feb 1996 11:22:52 GMT
- Organization: Applied Database Labs, K.A.I.S.T
- Message-ID: <31188b07.11954912@news.kreonet.re.kr>
- NNTP-Posting-Host: swine.kaist.ac.kr
- X-Newsreader: Forte Agent .99d/32.168
-
- #include <stdio.h>
-
- /*
- * I think this is what you need ..... a recursive function that
- * printfs a string in order and with only a %c ... get it ?
- */
-
- foo( char *s, int len)
- {
- static int count=0;
-
- if ( count++ < len) {
- printf( "%c", *s++);
- foo( s, len);
- }
- }
-
- void main( void)
- {
- char *t = "Hello World\n";
-
- foo( t, strlen(t));
- }
- ___________
-
- Name: Jung w. Hahn
- Elm: jwhahn@cair.kaist.ac.kr
- Phone: 042-869-2959
-